<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Brand" %>
<%--  在第一行加入【JSP指令：page,include,taglib】 --%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>品牌管理页</title>
    <style type="text/css">
        table{
            width: 100%;
            border-collapse: collapse;
        }
        table td{
           border: 1px solid #000;
           text-align: center;
        }
        table tr{
           
        }
        /*  HTML5已不支持   border="1" cellspacing="0" width="800" */
    </style>
</head>
<body>
<input type="button" value="新增"><br>
<hr>
<%
    //List集合：有序、可重复
    //Set集合： 无序、不重复
    ArrayList<Brand> brandList = new ArrayList<>();
    Brand b1
            = new Brand(1, "三只松鼠", "三只松鼠股份有限公司", 10, "好吃不上火", 1);
    Brand b2
            = new Brand(2, "小米", "小米科技有限公司", 20, "are you ok", 1);
    Brand b3
            = new Brand(3, "格力", "格力股份有限公司", 50, "好空调格力造", 0);

    brandList.add(b1);
    brandList.add(b2);
    brandList.add(b3);
    Brand b4
            = new Brand(4, "华为", "华为技术有限公司", 80, "华为，中国造", 1);
    brandList.add(b4);

%>

<table >
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>

    </tr>
    <%
        for (int i = 0; i < brandList.size(); i++) {

    %>
        <tr>
            <td><%= brandList.get(i).getId() %></td>
            <td><%= brandList.get(i).getBrandName() %></td>
            <td><%= brandList.get(i).getCompanyName() %></td>
            <td><%= brandList.get(i).getOrdered() %></td>
            <td><%= brandList.get(i).getDescription() %></td>
            <td><%= brandList.get(i).getStatus()==1?"启用":"禁用" %></td>
            <td><a href="#">修改</a> <a href="#">删除</a></td>
        </tr>
    <%
        }
    %>




</table>

</body>
</html>